<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title></title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport"
              content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
        <link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
</head>
<body>
<form class="layui-form" action="" lay-filter="component-form-group">
    <div class="layui-fluid">

        <table class="layui-hide" id="table-WZD" lay-filter="table-WZD"></table>
        <div class="layui-card-header">
		                               <span class="layui-layout-right" style="margin-right: 20px; margin-top: -10px;">
                                       <button class="layui-btn layui-btn-danger layui-btn-sm" id="Ts">新增排除商户信息</button>
				                       </span>
        </div>

<!--        <div class="layui-row layui-col-space15">-->
<!--            <div class="layui-col-md12">-->
<!--                <div class="layui-tab layui-tab-card">-->
<!--                    <ul class="layui-tab-title">-->
<!--                        <li class="layui-this">商户信息</li>-->

<!--                    </ul>-->
<!--                    <div class="layui-tab-content" style="background-color: #FFF;">-->
<!--                        <div class="layui-tab-item layui-show">-->
<!--                            <table class="layui-hide" id="table-WZD" lay-filter="table-WZD"></table>-->
<!--                            <div class="layui-card-header">-->
<!--		                               <span class="layui-layout-right" style="margin-right: 20px; margin-top: -10px;">-->
<!--                                       <button class="layui-btn layui-btn-danger layui-btn-sm" id="Ts">新增排除商户信息</button>-->
<!--				                       </span>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="layui-tab-item">-->
<!--                            <table class="layui-hide" id="Pzyzd"></table>-->
<!--                            <div id="page_container"></div>&lt;!&ndash; 新增 &ndash;&gt;-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

<!--            </div>-->
<!--        </div>-->
    </div>
    <script src="layuiadmin/layui/layui.js"></script>
<!--    <script typetype="text/javascript"></script>&lt;!&ndash; 新增 &ndash;&gt;-->
    <script>
        layui.config({
            base: 'layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table','upload', 'form'], function(){
            var table = layui.table;
            table.render({
                elem: '#table-WZD'
                ,url: 'http://localhost:8086/getSupplier'
                ,limits:[7]
                , limit: 7 //每页默认显示的数量
                , page: true
                , height:'full-100'
                ,cols: [
                        [
                            {type:'checkbox'}
                            ,{type:'number',title:'序号',templet: '#xuhao',width:60, align:'center'}
                            ,{field:'vENDORCODE', title:'商户', width:120, align:'center'}
                            ,{field:'vENDORNAME', title:'编码', align:'center'}
                            ,{field:'rEGISTEREDAREA', title:'ID', width: 150, align:'center'}
                            ,{field:'pHONE', title:'ID', width: 150, align:'center'}
                            ,{field:'aDDRESS', title:'名字', width: 150, align:'center'}
                            ,{field:'dDLD', title:'电话',width: 150, align:'center'}
                            ,{field:'eNABLEDFLAG', title:'地区',width: 150, align:'center'}
                        ]
                    ]
            });

            //事件监听获取选中的复选框的值
            table.on('checkbox(table-WZD)', function () {
                var checkStatus = table.checkStatus('table-WZD');
                console.log("选中的值1!!");
                console.log(checkStatus.data)//选中行数据
            });


            $("#Ts").click(function () {
                var index = parent.layer.getFrameIndex(window.name);
                var checkStatus = table.checkStatus('table-WZD');//获取选中的值
                console.log("选中的值");
                // console.log(checkStatus.data);
                var paramJson3 = JSON.stringify(checkStatus.data);
                console.log(paramJson3);
                $.ajax({
                    url: 'http://192.168.30.9:8088/wd/insertPingZheng',
                    type: 'post',
                    data: paramJson3,
                    dataType: 'json',
                    contentType: 'application/json; charset=utf-8',
                    success: function (paramJson3) {
                        alert(paramJson3.msg);
                        location.reload();
                        /*  if (info.Success === "True") {
                             alert("审核成功");
                             location.reload();
                         } else {
                             alert("审批失败");
                             location.reload();
                         } */
                    }
                });
            });
        });
    </script>
</form>
</body>
</html>